<?php use_javascript('jquery-1.3.2.min.js') ?>
<?php use_helper ('Form','Javascript','Object') ?>

<?php use_javascript('prototype.js') ?>		
<?php use_javascript('effects.js') ?>		
<?php use_javascript('dragdrop.js') ?>		
<?php use_javascript('popup.js') ?>		
<link href="<?php echo _compute_public_path('popup', 'css', 'css', false);  ?>" rel="stylesheet" type="text/css" />	

<table width="100%" border="0" cellspacing="0" cellpadding="0"  class="heading_table">
    <tr>
        <td height="30"><span class="heading">List of Vacant Buildings at Stations</span></td>
        <td align="right" height="30" valign="bottom">&nbsp;</td>
    </tr>
    
</table> 
 

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="datagrid">
             
    <tr>
        <th width="8%" style="text-align:left;">Station</th>
        <th width="23%" style="text-align:left;">Building Name</th>
        <th width="17%" style="text-align:left;">Consumer No.</th>
        <th width="14%" style="text-align:left;">Meter No.</th>
        <th width="17%" style="text-align:left;">Meter Phase</th>
        <th width="13%" style="text-align:left;">Last Updated</th>
        <th width="8%" style="text-align:left;">Status</th>
   </tr>

<!-- Populating the List -->
<?php if (count($buildings)): ?>
    <?php $previous = "";?>
	<?php foreach ($buildings as $j => $building) : ?>
    <?php $current = $building->getStation(); ?>
        <?php if ($current != $previous): ?>
        <tr>
            <td colspan="7" class="subhdng">
            <strong><?php echo $current ;?></strong>
            </td>
        </tr>
    <?php endif; ?>

    <tr>
        <td align="left">&nbsp;<?php //echo $building->getStation(); ?></td>
        <td align="left"><?php echo $building->getBuildingNo(); ?> </td>
        <td align="left"><?php echo $building->getConsumerNo(); ?></td>
        <td align="left"><?php echo $building->getMeterNo(); ?></td>
        <td align="left">&nbsp;<?php echo $building->getMeterPhase(); ?></td>
        <td align="center"><?php echo $building->getUpdatedAt('d-M-Y'); ?>
        <td align="center"><?php echo 'Vacant' ?></td>
    </tr>
<?php $previous = $current;?>
<?php endforeach; ?>
    <tr>
   		<td class="last">&nbsp;</td>
    </tr>
<?php else:?>

<tr>
	<td colspan="6" style="background:none; text-align:center;"><?php echo Constant::RECORD_NOT_FOUND; ?></td>
</tr>

<?php endif; ?>
</table>